<div class="row toolbar">
  <div class="col-md-6">
    <span class="toolbar-header">
      <%= @drug.new_record? ? "#{t(:new_drug)}" : "#{t(:edit)} #{t(:drug)}" %> 
    </span>
  </div>
  <div class="col-md-6 text-right">
    <ul class="toolbar-nav">
      <li><%= link_to simple_icon("note"), drugs_path %></li>
      <li><%= link_to simple_icon("note"), new_drug_stock_logging_path(:drug_id => "transactions") %></li>
    </ul>
  </div>
</div>

<%= form_for(@drug) do |f| %>
  <% if @drug.errors.any? %>
    <div id="error_explanation">
      <h2><%= pluralize(@drug.errors.count, "error") %> prohibited this drug from being saved:</h2>

      <ul>
      <% @drug.errors.full_messages.each do |message| %>
        <li><%= message %></li>
      <% end %>
      </ul>
    </div>
  <% end %>

  <div class="form-group">
    <%= f.label :code %><br>
    <%= f.text_field :code %>
  </div>
  <div class="form-group">
    <%= f.label :name %><br>
    <%= f.text_field :name %>
  </div>
  <div class="form-group">
    <%= f.label :price_per_item %><br>
    <%= f.text_field :price_per_item %>
  </div>
  <div class="form-group">
    <%= f.label :description %><br>
    <%= f.text_area :description %>
  </div>
  <%= hidden_field_tag 'selected', params[:drug_id]  %>
  <%= f.submit class: "btn btn-primary" %>
<% end %>
